package cn.com.landsky.camera.controller;

import cn.com.landsky.camera.common.utils.HikvisionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/***
 ** @category 事件服务订阅...
 ** @author qing.yunhui
 ** @email: qingyunhui@landsky.cn
 ** @createTime: 2019/1/11-16:05
 **/
@Controller
@RequestMapping(value="/event")
@Slf4j
@Api(value = "EventController", description = "事件服务控制器")
public class EventController {

    @RequestMapping(value = "/subscriptionByEventTypes.htm",method ={RequestMethod.GET},produces = { "application/json;charset=UTF-8" })
    @ApiOperation(value = "事件订阅")
    @ResponseBody
    public String subscriptionByEventTypes(String eventReceiveUrl,int enventType){
        String result=HikvisionUtil.callSubscriptionByEvent(eventReceiveUrl,enventType);
        log.info("result:{}",new Object[]{result});
        return result;
    }

}
